package com.banciyuan.bcywebview.biz.write.photoselecotor.pselector.decoration;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by squall on 2017/3/16.
 */

public class PhotoDecoration extends RecyclerView.ItemDecoration {

    private int offset;

    public PhotoDecoration(int offset) {
        this.offset = offset;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view,
                               RecyclerView parent, RecyclerView.State state) {
        if ((parent.getChildLayoutPosition(view)) >= 3) {
            outRect.top = offset;
        }
        outRect.right = offset;
    }
}
